fixed a few bugs.
small improvments.