Tweaks from cdchen and euricojardim