Fixing some unit tests quickly.
Fixing issues: #304, #303 and #300