bugfixes
better error outpur
merge