Cleanup whitespaces
Fix Commit() so that it always updates the HEAD

Fix #692
Make Travis build target osx platform