Fixed up code for publishing