Various bug fix + Settings API bad implementation causing segfault in Apache