Updated for latest master (fixes #11).