Better alias check
Removed unused variable initialization
Fixed phpdoc