Few fixes.

see #585