More additions and bug fixes to version 2.