couple of small bugs fixed