Handling Malformed Token Error

Fixes #385