more fixes and addressing @sstok comments