Bug fixed. Code optimized.