fixed a few issues raised by @er.pushpinderrana. Ready for a 7.x-1.0-RC1. Closes #22.