Fixes issue #123, #124, #125