minor bugs sorted out