Issues 290, 291 and 292

This should solve the issues #290, #291 and #292.