Fixed bug 297 & 298