bugfixes for red
red tweaking