diff --git a/py/bc.c b/py/bc.c
index b5515bcd7916136ffa7c1b666a9faf7a19334843..47f8d9f713ca2f6384dfd30435a4c9901bb53a37 100644
--- a/py/bc.c
+++ b/py/bc.c
@@ -44,6 +44,7 @@
 #if 0 // print debugging info
 #define DEBUG_PRINT (1)
 #else // don't print debugging info
+#define DEBUG_PRINT (0)
 #define DEBUG_printf(...) (void)0
 #endif
 
diff --git a/py/builtinimport.c b/py/builtinimport.c
index af93aace910d84b64b605b37ca4ddb4f00eb21b1..f1288744a8caafd46c7be379c8fd6734235147d7 100644
--- a/py/builtinimport.c
+++ b/py/builtinimport.c
@@ -50,6 +50,7 @@
 #define DEBUG_PRINT (1)
 #define DEBUG_printf DEBUG_printf
 #else // don't print debugging info
+#define DEBUG_PRINT (0)
 #define DEBUG_printf(...) (void)0
 #endif
 
diff --git a/py/gc.c b/py/gc.c
index fca5050e79222edeba04685cc2b1c6e3fe16326f..4d9334056503b9a52fc9d16e7dd80818f5bc7760 100644
--- a/py/gc.c
+++ b/py/gc.c
@@ -44,6 +44,7 @@
 #define DEBUG_PRINT (1)
 #define DEBUG_printf DEBUG_printf
 #else // don't print debugging info
+#define DEBUG_PRINT (0)
 #define DEBUG_printf(...) (void)0
 #endif
 
@@ -746,7 +747,9 @@ void gc_dump_alloc_table(void) {
                 if (*ptr == (mp_uint_t)&mp_type_tuple) { c = 'T'; }
                 else if (*ptr == (mp_uint_t)&mp_type_list) { c = 'L'; }
                 else if (*ptr == (mp_uint_t)&mp_type_dict) { c = 'D'; }
+                #if MICROPY_PY_BUILTINS_FLOAT
                 else if (*ptr == (mp_uint_t)&mp_type_float) { c = 'F'; }
+                #endif
                 else if (*ptr == (mp_uint_t)&mp_type_fun_bc) { c = 'B'; }
                 else if (*ptr == (mp_uint_t)&mp_type_module) { c = 'M'; }
                 else { c = 'h'; }
diff --git a/py/map.c b/py/map.c
index 906a1611f0d2ef7aee84d66c2ce3f00cd603e5a6..fb0c5a0795bb588f2ca624d4d577dbf148ffe733 100644
--- a/py/map.c
+++ b/py/map.c
@@ -358,7 +358,7 @@ void mp_set_clear(mp_set_t *set) {
     set->table = NULL;
 }
 
-#if DEBUG_PRINT
+#if defined(DEBUG_PRINT) && DEBUG_PRINT
 void mp_map_dump(mp_map_t *map) {
     for (mp_uint_t i = 0; i < map->alloc; i++) {
         if (map->table[i].key != NULL) {
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 8ef3e62feccd431005943338a80cdf0ae315ca33..02c6674d8bc6866907a0236a4a8a392a8eb29cbe 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -184,8 +184,8 @@
 #endif
 
 // Whether to enable finalisers in the garbage collector (ie call __del__)
-#ifndef MICROPY_ENABLE_GC_FINALISER
-#define MICROPY_ENABLE_GC_FINALISER (0)
+#ifndef MICROPY_ENABLE_FINALISER
+#define MICROPY_ENABLE_FINALISER (0)
 #endif
 
 // Whether to check C stack usage. C stack used for calling Python functions,
diff --git a/py/nlr.h b/py/nlr.h
index cb2b53b854eabe642a05806422db88dd5c156075..32e4b7cb2d71a05aef55348bde680049009d8778 100644
--- a/py/nlr.h
+++ b/py/nlr.h
@@ -36,7 +36,7 @@ struct _nlr_buf_t {
     // the entries here must all be machine word size
     nlr_buf_t *prev;
     void *ret_val;
-#if !MICROPY_NLR_SETJMP
+#if !defined(MICROPY_NLR_SETJMP) || !MICROPY_NLR_SETJMP
 #if defined(__i386__)
     void *regs[6];
 #elif defined(__x86_64__)
diff --git a/py/nlrthumb.S b/py/nlrthumb.S
index 5443edfe84c195243b51500e5efc13a61227279c..dcbcc2770d88ff04b2fb033e73e38c2edf4361d7 100644
--- a/py/nlrthumb.S
+++ b/py/nlrthumb.S
@@ -24,7 +24,7 @@
  * THE SOFTWARE.
  */
 
-#if !MICROPY_NLR_SETJMP && (defined(__thumb2__) || defined(__thumb__) || defined(__arm__))
+#if (!defined(MICROPY_NLR_SETJMP) || !MICROPY_NLR_SETJMP) && (defined(__thumb2__) || defined(__thumb__) || defined(__arm__))
 
 // We only need the functions here if we are on arm/thumb, and we are not
 // using setjmp/longjmp.
@@ -138,4 +138,4 @@ nlr_jump:
 nlr_top:
     .space  4
 
-#endif // !MICROPY_NLR_SETJMP && (defined(__thumb2__) || defined(__thumb__) || defined(__arm__))
+#endif // (!defined(MICROPY_NLR_SETJMP) || !MICROPY_NLR_SETJMP) && (defined(__thumb2__) || defined(__thumb__) || defined(__arm__))
diff --git a/py/objfun.c b/py/objfun.c
index 3adf05e3b0e410e9ff3fdbab6b1cb80859846477..5f95a015bc7578b76e1c3e9c00582f4b9a6cb2f9 100644
--- a/py/objfun.c
+++ b/py/objfun.c
@@ -44,6 +44,7 @@
 #if 0 // print debugging info
 #define DEBUG_PRINT (1)
 #else // don't print debugging info
+#define DEBUG_PRINT (0)
 #define DEBUG_printf(...) (void)0
 #endif
 
diff --git a/py/objtype.c b/py/objtype.c
index 171ea838f21ffc874f276354b4c5f9fac0a7b5ca..70dc226a60387b0579b9096ef09ef0f29c5825cf 100644
--- a/py/objtype.c
+++ b/py/objtype.c
@@ -43,6 +43,7 @@
 #define DEBUG_PRINT (1)
 #define DEBUG_printf DEBUG_printf
 #else // don't print debugging info
+#define DEBUG_PRINT (0)
 #define DEBUG_printf(...) (void)0
 #endif
 
diff --git a/stmhal/printf.c b/stmhal/printf.c
index 137189b94db3f059663c81889d5bcd17ba69ab7f..ca9b279cdb78c057fa60d2687b4af7336c950801 100644
--- a/stmhal/printf.c
+++ b/stmhal/printf.c
@@ -29,17 +29,10 @@
 #include <stdarg.h>
 
 #include "mpconfig.h"
-#include "std.h"
 #include "misc.h"
-#include "systick.h"
 #include "qstr.h"
 #include "obj.h"
 #include "pfenv.h"
-#if 0
-#include "lcd.h"
-#endif
-#include "uart.h"
-#include "usb.h"
 #include "pybstdio.h"
 
 #if MICROPY_PY_BUILTINS_FLOAT
diff --git a/stmhal/pybstdio.h b/stmhal/pybstdio.h
index cdb7acfe59387126074dc032f3364d93857757e7..08a2d03638e9587cb1762096380afdf763c371ef 100644
--- a/stmhal/pybstdio.h
+++ b/stmhal/pybstdio.h
@@ -24,7 +24,7 @@
  * THE SOFTWARE.
  */
 
-extern pyb_uart_obj_t *pyb_stdio_uart;
+extern struct _pyb_uart_obj_t *pyb_stdio_uart;
 
 void stdout_tx_str(const char *str);
 void stdout_tx_strn(const char *str, mp_uint_t len);