Bug fixes; closes #19