Minor formatting changes and safety added to catmapping.js