Fixed constructor signature.
Fixed up error messages.
Refactor duplicated code.
Few style fixes.
Patch from d.o issues. Closes #8.