Bug fixing

Small bugs squashed