diff --git a/Sming/Arch/Host/Components/driver/hw_timer.cpp b/Sming/Arch/Host/Components/driver/hw_timer.cpp
index 6e8abc7172..0724df0a06 100644
--- a/Sming/Arch/Host/Components/driver/hw_timer.cpp
+++ b/Sming/Arch/Host/Components/driver/hw_timer.cpp
@@ -44,7 +44,7 @@ class CTimerThread : public CThread
 	void attach_interrupt(hw_timer_source_type_t source_type, hw_timer_callback_t callback, void* arg)
 	{
 		stop();
-		source_type = source_type;
+		this->source_type = source_type;
 		this->callback.func = callback;
 		this->callback.arg = arg;
 	}
diff --git a/Sming/Arch/Host/Components/driver/uart_server.cpp b/Sming/Arch/Host/Components/driver/uart_server.cpp
index 2b0e5ad0a5..7c51ca1d35 100644
--- a/Sming/Arch/Host/Components/driver/uart_server.cpp
+++ b/Sming/Arch/Host/Components/driver/uart_server.cpp
@@ -209,7 +209,7 @@ void CUart::onNotify(smg_uart_t* uart, smg_uart_notify_code_t code)
 		break;
 
 	case UART_NOTIFY_AFTER_WRITE: {
-		if(uart != nullptr) {
+		if(this->uart != nullptr) {
 			// Kick the thread to send now
 			txsem.post();
 		} else {
diff --git a/Sming/Core/si2c.cpp b/Sming/Core/si2c.cpp
index 521120d151..924cf6a051 100644
--- a/Sming/Core/si2c.cpp
+++ b/Sming/Core/si2c.cpp
@@ -249,7 +249,7 @@ uint8_t twi_status()
 
 	int clockCount = 20;
 
-	while(SDA_READ() == 0 && clockCount > 0) { //if SDA low, read the bits slaves have to sent to a max
+	while(SDA_READ() == 0 && clockCount-- > 0) { //if SDA low, read the bits slaves have to sent to a max
 		twi_read_bit();
 		if(SCL_READ() == 0) {
 			return I2C_SCL_HELD_LOW_AFTER_READ; //I2C bus error. SCL held low beyond slave clock stretch time