Scope and variable initialization errors handled