Adjusted test; fixed bugs