Fixes a bug in writing analog output