Added patch for this issue. Also fixed some coding standard issues.