Fixed bug which breaks browser execution when value is null or undefined
Fixed command handler dispatching bug
Fixed code style
Added preventDefault() when clicking on opened layer