Some bugs fixed for LINUX