Fixes as a result of Chris's tests