diff --git a/Language/Javascript/JMacro/Base.hs b/Language/Javascript/JMacro/Base.hs
--- a/Language/Javascript/JMacro/Base.hs
+++ b/Language/Javascript/JMacro/Base.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE FlexibleInstances, UndecidableInstances, OverlappingInstances, OverloadedStrings, TypeFamilies, RankNTypes, DeriveDataTypeable, StandaloneDeriving, FlexibleContexts, TypeSynonymInstances, ScopedTypeVariables, GADTs #-}
+{-# LANGUAGE FlexibleInstances, UndecidableInstances, OverlappingInstances, OverloadedStrings, TypeFamilies, RankNTypes, DeriveDataTypeable, StandaloneDeriving, FlexibleContexts, TypeSynonymInstances, ScopedTypeVariables, GADTs, GeneralizedNewtypeDeriving #-}
 
 -----------------------------------------------------------------------------
 {- |
@@ -160,7 +160,7 @@
 -- | Values
 data JVal = JVar     Ident
           | JList    [JExpr]
-          | JDouble  Double
+          | JDouble  SaneDouble
           | JInt     Integer
           | JStr     String
           | JRegEx   String
@@ -169,6 +169,19 @@
           | UnsatVal (IdentSupply JVal)
             deriving (Eq, Ord, Show, Data, Typeable)
 
+newtype SaneDouble = SaneDouble Double deriving (Data, Typeable, Fractional, Num)
+
+instance Eq SaneDouble where
+    (SaneDouble x) == (SaneDouble y) = x == y || (isNaN x && isNaN y)
+
+instance Ord SaneDouble where
+    compare (SaneDouble x) (SaneDouble y) = compare (fromNaN x) (fromNaN y)
+        where fromNaN z | isNaN z = Nothing
+                        | otherwise = Just z
+
+instance Show SaneDouble where
+    show (SaneDouble x) = show x
+
 -- | Identifiers
 newtype Ident = StrI String deriving (Eq, Ord, Show, Data, Typeable)
 
@@ -522,7 +535,7 @@
 instance JsToDoc JVal where
     jsToDoc (JVar i) = jsToDoc i
     jsToDoc (JList xs) = brackets . fillSep . punctuate comma $ map jsToDoc xs
-    jsToDoc (JDouble d) = double d
+    jsToDoc (JDouble (SaneDouble d)) = double d
     jsToDoc (JInt i) = integer i
     jsToDoc (JStr s) = text . T.pack $ "\""++encodeJson s++"\""
     jsToDoc (JRegEx s) = text . T.pack $ "/"++s++"/"
@@ -615,7 +628,7 @@
     toJExpr = ValExpr . JHash . M.map toJExpr
 
 instance ToJExpr Double where
-    toJExpr = ValExpr . JDouble
+    toJExpr = ValExpr . JDouble . SaneDouble
 
 instance ToJExpr Int where
     toJExpr = ValExpr . JInt . fromIntegral
diff --git a/Language/Javascript/JMacro/QQ.hs b/Language/Javascript/JMacro/QQ.hs
--- a/Language/Javascript/JMacro/QQ.hs
+++ b/Language/Javascript/JMacro/QQ.hs
@@ -437,7 +437,7 @@
           return [ForeignStat i t]
 
       returnStat =
-        reserved "return" >> (:[]) . ReturnStat <$> option (ValExpr $ JVar $ StrI "null") expr
+        reserved "return" >> (:[]) . ReturnStat <$> option (ValExpr $ JVar $ StrI "undefined") expr
 
       ifStat = do
         reserved "if"
@@ -519,6 +519,7 @@
           (e1,op) <- try $ liftM2 (,) dotExpr (fmap (take 1) $
                                                    rop "="
                                                <|> rop "+="
+                                               <|> rop "-="
                                                <|> rop "*="
                                                <|> rop "/="
                                                <|> rop "%="
@@ -529,10 +530,10 @@
                                                <|> rop "^="
                                                <|> rop "|="
                                               )
-          let gofail = fail ("Invalid assignment.")
+          let gofail  = fail ("Invalid assignment.")
+              badList = ["this","true","false","undefined","null"]
           case e1 of
-            ValExpr (JVar (StrI "this")) -> gofail
-            ValExpr (JVar _) -> return ()
+            ValExpr (JVar (StrI s)) -> if s `elem` badList then gofail else return ()
             ApplExpr _ _ -> gofail
             ValExpr _ -> gofail
             _ -> return ()
diff --git a/jmacro.cabal b/jmacro.cabal
--- a/jmacro.cabal
+++ b/jmacro.cabal
@@ -1,5 +1,5 @@
 name:                jmacro
-version:             0.6.5
+version:             0.6.6
 synopsis:            QuasiQuotation library for programmatic generation of Javascript code.
 description:         Javascript syntax, functional syntax, hygienic names, compile-time guarantees of syntactic correctness, limited typechecking. Additional documentation available at <http://www.haskell.org/haskellwiki/Jmacro>
 category:            Language
