Fix drawing problems. Added more message handling.