Fix preprocessing and brute force bugs