query optimisation was implemented. Memory leak was fixed. Verbose cosmetic
Merge pull request #273 from AlexanderSavelyev/fmcs_port_21Feb2014

query optimisation was implemented. Memory leak was fixed. Verbose cosmetic