Fixed changing prefix, post merging. Fixed one point in error handling.

Honestly, it was really annoying to debug.