adding two minor manual patches. hopefully the right syntax