#20 and #21 bugfix