Minor bug in rebuild