Fixing #328 and #327

https://github.com/esvit/ng-table/issues/328
https://github.com/esvit/ng-table/issues/327