Small fixes and memory leak removed. Fixes: CID#1136402

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>