refs #5, bug fixes