Fixed Issue331 errors

Bug fixes related to Issue-331.