Simple mode library bugfixes. Fixes #565

See issue #565