Fix reported bugs