bug fixes (NullPointer), Pirate Dotty added