Add abort statements. Bugfixes