adding more information to IOException if mapping fails. Some test enhancements