Fixed several bugs.  View the issues tab in github for further
information.