Further bug fixes to Vivado code