Fixed bug in prepare stage + Improved problems fixing