Merged code from webfaction