Fixed compiler warnings and potential out of range bug in geometry
transformation