diff --git a/bin/compile b/bin/compile
index 5d164de45acb376f3a115bd781d18472b243f652..fac6d0f90152a510a5a6413f8cab0ea33ebbc1ce 100755
--- a/bin/compile
+++ b/bin/compile
@@ -60,7 +60,7 @@ mkdir .heroku
 
 
 # if pylibmc within requirements, use vendored libmemcached
-if grep -Fxq "pylibmc" requirements.txt
+if (grep -Fxiq "pylibmc" requirements.txt) || (grep -Fiq "pylibmc=" requirements.txt)
 then
     echo "-----> Noticed pylibmc. Bootstrapping libmemcached."
     cd .heroku
@@ -94,7 +94,7 @@ import os, sys, urlparse
 urlparse.uses_netloc.append('postgres')
 urlparse.uses_netloc.append('mysql')
 try:
-    if os.environ.has_key('DATABASE_URL'):
+    if os.environ.has_key('DATABASE_URL') and DATABASE != None:
         url = urlparse.urlparse(os.environ['DATABASE_URL'])
         DATABASES['default'] = {
             'NAME':     url.path[1:],