Add more error codes, messages and error checking.
Merge pull request #39 from teknico/vp

Add more error codes, messages and error checking.