Fixes bugs for testing