Bug fixes & code refine.