Backend tests + minor bug fixes