Minor improvements and compile option added