#267 - fixing bugs
#267 - fixing more bugs