Issues #120, #122 and #123 fixed