Bug fixes

Fix #156.
Small fixes.