Fixes for density on the fly