Bugfixes from implementation testing. #0