Sync'ed with city41/master branch