Bug fixes and refactoring

OnDrop logic update
Fixed issue in case of more than one file dropped
Debug directives
Comments for functions