Merged new stuff from hydro_dev and seams to work properly.