Fixed warnings of strict standards and some bugs.