Apply @bhogancvtc's fix for center function

This closes #1