Cleaned up centering behaviour.