Fix bugs so that correlationlength builds on Ubuntu