Minor bug fix; improved logging