Fixed a memory leak
Merge remote-tracking branch 'origin/master'
Fixed indentation, added constants, removed a «horrible» if structure