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