Created Error object for error reporting
Improved IF-THEN-ELSE structure and more semantics in its parts.
Return Error type on failure.
Updated todo.