Index: uspace/drv/usbhub/port_status.h
===================================================================
--- uspace/drv/usbhub/port_status.h	(revision e5ccfd175b64e5de8ff32f502aa4355fc38b516d)
+++ uspace/drv/usbhub/port_status.h	(revision d7f3040b05eb1e999aba1fed9b3deed8be818719)
@@ -257,5 +257,5 @@
  */
 static inline bool usb_port_get_bit(usb_port_status_t * status, int idx) {
-	return (*status)&(1 << idx);
+	return ((*status)&(1 << idx))!=0;
 }
 
Index: uspace/drv/usbhub/usbhub.c
===================================================================
--- uspace/drv/usbhub/usbhub.c	(revision e5ccfd175b64e5de8ff32f502aa4355fc38b516d)
+++ uspace/drv/usbhub/usbhub.c	(revision d7f3040b05eb1e999aba1fed9b3deed8be818719)
@@ -229,11 +229,11 @@
 	{
 		unsigned int port;
-		for (port = 1; port <= port_count; ++port) {
+		for (port = 0; port < port_count; ++port) {
 			bool is_non_removable =
 				hub_info->not_initialized_non_removables[port/8]
-				& (1 << (port % 8));
+				& (1 << (port-1 % 8));
 			if (is_non_removable) {
 				opResult = initialize_non_removable(hub_info,
-					port);
+					port+1);
 			}
 		}
@@ -470,5 +470,8 @@
 	usb_speed_t speed) {
 	//if this hub already uses default address, it cannot request it once more
-	if (hub->is_default_address_used) return EREFUSED;
+	if (hub->is_default_address_used) {
+		usb_log_info("default address used, another time\n");
+		return EREFUSED;
+	}
 	usb_log_debug("some connection changed\n");
 	assert(hub->control_pipe->hc_phone);
@@ -710,5 +713,4 @@
 		usb_log_debug("connection change on port\n");
 		if (usb_port_dev_connected(&status)) {
-			usb_log_debug("some connection changed\n");
 			usb_hub_init_add_device(hub, port,
 				usb_port_speed(&status));
@@ -743,5 +745,5 @@
 	/// \TODO what about port power change?
 	if (status >> 16) {
-		usb_log_info("there was some unsupported change on port %d: %X\n",
+		usb_log_info("there was unsupported change on port %d: %X\n",
 			port, status);
 
@@ -898,10 +900,11 @@
 	if (usb_port_dev_connected(&status)) {
 		usb_log_debug("there is connected device on this port\n");
+		opResult = usb_hub_init_add_device(hub_info, port,
+			usb_port_speed(&status));
 	}else{
 		usb_log_debug("the non-removable device is not connected\n");
-	}
-	if (!hub_info->is_default_address_used)
-		usb_hub_init_add_device(hub_info, port,
-			usb_port_speed(&status));
+		opResult = EINVAL;
+	}
+	
 	return opResult;
 }
@@ -1021,5 +1024,5 @@
 	for (port = 1; port <= descriptor->ports_count; ++port) {
 		bool is_non_removable =
-			((non_removable_dev_bitmap[port / 8]) >> (port % 8)) % 2;
+			((non_removable_dev_bitmap[(port-1) / 8]) >> ((port-1) % 8)) % 2;
 		if (is_non_removable) {
 			usb_log_debug("CHECKING port %d is non-removable\n",
