Improved comments and error message
Added missing TODOs