Fixing bugs all over the place (including the numpy value comparison thing)