diff --git a/style/booktabs.el b/style/booktabs.el
index e126872..3874a10 100644
--- a/style/booktabs.el
+++ b/style/booktabs.el
@@ -1,6 +1,6 @@
 ;;; booktabs.el -- AUCTeX style for booktabs.sty
 
-;; Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2013 Free Software Foundation, Inc.
 
 ;; Author:   Ralf Angeli <angeli@iwi.uni-sb.de>
 ;; Maintainer: auctex-devel@gnu.org
@@ -38,19 +38,26 @@ PROMPT is the value of the prompt to be shown."
 	(> "\)"))
     (TeX-parse-argument optional prompt)))
 
+(defun LaTeX-booktabs-arg-thickness (optional)
+  "Set `TeX-insert-braces' to nil and prompt for a thickness argument."
+  ;; Override the value of `TeX-insert-braces' setting it to nil: a non nil
+  ;; value would insert an empty group after the {top,mid,bottom}rule macros
+  ;; when the input is empty, causing a wrong spacing.
+  (setq TeX-insert-braces nil)
+  (TeX-arg-string optional "Thickness" nil))
+
 (TeX-add-style-hook
  "booktabs"
  (lambda ()
 
    ;; New symbols
    (TeX-add-symbols
-    '("toprule" [ "Thickness" ])
-    '("midrule" [ "Thickness" ])
-    '("bottomrule" [ "Thickness" ])
-    ;; FIXME: The qestion for the trim parameter will only be asked if
-    ;; a value for the thickness parameter was given.  Is this a
-    ;; feature of `TeX-parse-arguments'?
-    '("cmidrule" [ "Thickness" ] [ LaTeX-booktabs-arg-paren "Trim" ]
+    '("toprule" [ LaTeX-booktabs-arg-thickness ])
+    '("midrule" [ LaTeX-booktabs-arg-thickness ])
+    '("bottomrule" [ LaTeX-booktabs-arg-thickness ])
+    ;; The `ignore' resets `last-optional-rejected' to nil so that the trim
+    ;; argument is prompted also when the thickness is skipped.
+    '("cmidrule" [ "Thickness" ] (ignore) [ LaTeX-booktabs-arg-paren "Trim" ]
       "Column(s)")
     '("addlinespace" [ "Height" ])
     '("morecmidrules")
@@ -69,6 +76,6 @@ PROMPT is the value of the prompt to be shown."
 			      'function))))
 
 (defvar LaTeX-booktabs-package-options nil
-  "Package options for the booktabs package.")			
+  "Package options for the booktabs package.")
 
 ;;; booktabs.el ends here
diff --git a/tex.el b/tex.el
index 66e22cd..98a72a5 100644
--- a/tex.el
+++ b/tex.el
@@ -2708,7 +2708,11 @@ type of ARGS:
       (exchange-point-and-mark))
   (insert TeX-esc symbol)
   (let ((exit-mark (make-marker))
-	(position (point)))
+	(position (point))
+	;; We keep the original value of `TeX-insert-braces' because it will be
+	;; restored at the end.  In this way the original value can be
+	;; overridden, if needed.
+	(original-insert-braces TeX-insert-braces))
     (TeX-parse-arguments args)
     (cond ((marker-position exit-mark)
 	   (goto-char (marker-position exit-mark))
@@ -2731,7 +2735,8 @@ type of ARGS:
 		   (exchange-point-and-mark)
 		   (insert TeX-grcl))
 	       (insert TeX-grcl)
-	       (backward-char)))))))
+	       (backward-char)))))
+    (setq TeX-insert-braces original-insert-braces)))
 
 (defun TeX-arg-string (optional &optional prompt initial-input)
   "Prompt for a string.
