diff --git a/css/style.css b/css/style.css
index 6192321a98513f46a946509b2c8f69b507ff9296..9c2baefade036003749fc92b1c49e80be4fce66d 100644
--- a/css/style.css
+++ b/css/style.css
@@ -394,7 +394,7 @@ script {
   width : calc(100% - 30px) ;
   max-height : 100vh ;
   text-align : center ;
-  ponter-events : none ;
+  pointer-events : none ;
   box-sizing : content-box ;
 }
 
@@ -421,7 +421,7 @@ script {
   white-space : nowrap ;
 }
 
-#phone-toolbar.fixed-bottom > .btn-group {
+#phone-toolbar > .btn-group.fixed-bottom {
   position : fixed ;
   bottom : 10px ;
 }
diff --git a/js/pgm_construction.js b/js/pgm_construction.js
index 0d24beaa26c88f4c6dc070fa6a73475a4c366573..6993c557cc1b69d46306c2951f1e7e13c60bcee1 100644
--- a/js/pgm_construction.js
+++ b/js/pgm_construction.js
@@ -511,9 +511,9 @@ function library_fixed_switch() {
 
 function pin_library() {
   var lib_style = window.getComputedStyle(library) ;
-  var w = lib_style.getPropertyValue('width').replace(/px/, '') ;
-  var pl = lib_style.getPropertyValue('padding-left').replace(/px/, '') ;
-  var pr = lib_style.getPropertyValue('padding-right').replace(/px/, '') ;
+  var w = parseInt(lib_style.getPropertyValue('width').replace(/px/, '')) ;
+  var pl = parseInt(lib_style.getPropertyValue('padding-left').replace(/px/, '')) ;
+  var pr = parseInt(lib_style.getPropertyValue('padding-right').replace(/px/, '')) ;
   library_panel.style.width = (w - pl - pr) + 'px' ;
   document.body.addEventListener('scroll', library_fixed_switch) ;
 }
@@ -687,6 +687,9 @@ function pgm_add(evt) {
     //style the element
     addClass(el, "add-target") ;
     //store the element and its container in the context
+    if(el.tagName === 'INPUT') {
+      el = el.parentElement ;
+    }
     var container = el.parentElement ;
     pgm_context.element = el ;
     pgm_context.container = container ;
@@ -1009,9 +1012,9 @@ function phone_tools_get() {
 
 function phone_tools_fixed_switch() {
   if(pgm.getBoundingClientRect().top < 10) {
-    addClass(phone_toolbar, 'fixed-bottom') ;
+    addClass(phone_toolbar.children[0], 'fixed-bottom') ;
   } else {
-    removeClass(phone_toolbar, 'fixed-bottom') ;
+    removeClass(phone_toolbar.children[0], 'fixed-bottom') ;
   }
 }
 
@@ -1023,9 +1026,17 @@ function unpin_phone_toolbar() {
   document.body.removeEventListener('scroll', phone_tools_fixed_switch) ;
 }
 
+var toolbar_right = 0 ;
+
 function open_library() {
   var elem = document.getElementById("program") ;
   addClass(elem, "active") ;
+  var test_el = document.getElementById("mobile-tester") ;
+  if(getComputedStyle(test_el ,null).display !== "none") {
+    var scroll = pgm.getBoundingClientRect().top ;
+    var topval = Math.max(0, 10 - scroll) ;
+    library.style.top = topval + 'px' ;
+  }
 }
 
 function close_library() {
@@ -1046,6 +1057,7 @@ function mobile_activate() {
   mobile_activate_program() ;
   show_mobile_ui() ;
   pin_phone_toolbar() ;
+  phone_tools_fixed_switch() ;
 }
 
 function mobile_deactivate() {