Various bug fixing and testing, to be fixed "bad request"