Fix resise problem.
Cleaned code.