cleaned up bugs in reference region setting