Improve and fix bugs with auto mapping